package domain;

import java.util.ArrayList;
import java.util.List;

public class Vocabulary {
	private Integer id;
	private String word;
	private Integer maxFrequency; // max frequency of the word in all the documents
	private List<Post> postList;
	private boolean isUpdated;
	
	// Atributos utilizados para la ponderacion de la busqueda
	private int postListSize;

	public Vocabulary() {
		isUpdated = false;
		postList = new ArrayList<Post>();
	}

	public String getWord() {
		return word;
	}

	public void setWord(String word) {
		this.word = word;
	}

	public Integer getMaxFrequency() {
		return maxFrequency;
	}

	public void setMaxFrequency(Integer maxFrequency) {
		this.maxFrequency = maxFrequency;
	}

	public List<Post> getPostList() {
		return postList;
	}

	public void setPostList(List<Post> postList) {
		this.postList = postList;
	}

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public boolean equals(Object o) {
		Vocabulary value = (Vocabulary) o;
		boolean equals = false;
		if (value.id != null && this.id != null) {
			equals = equals || value.id.equals(this.id);
		}
		equals = equals || value.word.equalsIgnoreCase(this.word);
		return equals;
	}

	public boolean isUpdated() {
		return isUpdated;
	}

	public void setUpdated(boolean isUpdated) {
		this.isUpdated = isUpdated;
	}

	/**
	 * Acceso a postListSize
	 * @return valor del atributo postListSize
	 */
	public int getPostListSize() {
		return postListSize;
	}

	/**
	 * Modificador de postListSize
	 * @param postListSize nuevo valor del atributo postListSize
	 */
	public void setPostListSize(int postListSize) {
		this.postListSize = postListSize;
	}
}
